//@ts-ignore
import request from '@/utils/http.ts'
import { TradeMarkResponseData } from './type.ts'
enum API {
  TRADEMARK_API = '/admin/product/baseTrademark/',
  ADDTRADEMARK_API = '/admin/product/baseTrademark/save',
  EDITTRADEMARK_API = '/admin/product/baseTrademark/update',
  DELETETRADEMARH_API = '/admin/product/baseTrademark/remove/',
}
export const reqHasTrade = (page: number, limit: number) => {
  return request<any, TradeMarkResponseData>({
    url: API.TRADEMARK_API + `${page}/${limit}`,
  })
}
export const reqAddTrade = (tmName: string, logoUrl: string) => {
  return request<any, any>({
    url: API.ADDTRADEMARK_API,
    method: 'post',
    data: {
      tmName,
      logoUrl,
    },
  })
}
export const reqEditTrade = (id: number, tmName: string, logoUrl: string) => {
  return request<any, any>({
    url: API.EDITTRADEMARK_API,
    method: 'put',
    data: {
      id,
      tmName,
      logoUrl,
    },
  })
}
export const reqDelTrade = (id: number) => {
  return request<any, any>({
    url: API.DELETETRADEMARH_API + id,
    method: 'delete',
  })
}
